package cn.itcast.shop.utils;

import java.util.List;

public class PageBean<T> {
	private int page; //当前页数
	private int totalCount;//总记录数
	private int totalPage;//总页数
	private int limit=10;//每页显示的记录数
	private List<T> list;//每页显示数据的集合
	private int begin;//查询数据开始的条数
	
	public int getPage() {
		return page;
	}
	/**
	 * 当前页数
	 * @param page
	 */
	public void setPage(int page) {
		this.page = page;
	}
	
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	
	public int getTotalPage() {
		if (this.totalCount % this.limit == 0) {
			return this.totalCount / this.limit;
		} else {
			return (this.totalCount / this.limit + 1);
		}
	}
	public void setTotalPage(int totalPage) {
		this.totalPage =totalPage;
	}
	
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	
	public int getBegin() {
		return (this.page-1)*this.limit;
	}
	public void setBegin(int begin) {
		this.begin = begin;
	}
}
